package reflect;

import java.lang.reflect.Method;

/**
 * @author DBX
 * @effect 反射操作私有方法
 * @date 2021/09/15/15:21
 */
public class ReflectDemo7 {
    public static void main(String[] args) throws Exception{
        Class c = Class.forName("reflect.User");
        Object o = c.newInstance();
        Method method = c.getDeclaredMethod("fun");
        method.setAccessible(true);
        method.invoke(o);
    }
}
